import request from '@/utils/request';

//物料数据分页查询
export async function getMaterialInfoByPage(params: any) {
    return request('/api/basicData/getMaterialInfoByPage', {
        method: 'POST',
        data: params,
    });
}

//物料数据新增
export async function addMaterialInfo(params: any) {
    return request('/api/basicData/addMaterialInfo', {
        method: 'POST',
        data: params,
    })
}

//物料数据删除
export async function delMaterialInfo(params: any) {
    return request('/api/basicData/delMaterialInfo',{
        method:'POST',
        data: params,
    })
}

//物料数据更新
export async function updateMaterialInfo(params: any) {
    return request('/api/basicData/updateMaterialInfo',{
        method:'POST',
        data: params,
    })
}

//下载模板
export async function exportMaterialInfo(params: any) {
    return request('/api/basicData/exportMaterialInfo',{
        method:'POST',
        data: params,
        responseType: 'blob',
    })
}

//导入物料主数据
export async function uploadMaterialInfo(para: any) {
    return request('/api/basicData/uploadMaterialInfo',{
        method: 'POST',
        requestType: 'form',
        data: para.file,
    })
}

//根据属性获取物料主数据列表
export async function getMaterialInfoByMaterialProperty(para: any){
    return request('/api/basicData/getMaterialInfoByMaterialProperty',{
        method:'POST',
        params: {
            materialProperty: para,
        }
    })
}

//主数据同步
export async function materialBasicInfoSync() {
    return request('/api/materialBasicInfo/sync', {
      method: 'POST',
    });
  }
  
